<div class="layui-container">
	<form class="layui-form" action="">
		#for(col : cols)
		
		#if(col.name != "id" && col.javaType != "java.util.Date")
		<div class="layui-form-item">
			<label class="layui-form-label">#(col.remarks ??)</label>
			<div class="layui-input-block">
				<input type='#if(col.javaType == "java.lang.Integer" || col.javaType == "java.lang.Long")number#else text#end' #if(col.javaType == "java.lang.Integer" || col.javaType == "java.lang.Long") onkeypress="return jtUtil.noNumbers(event)" onkeyup="this.value=this.value.replace(/[\u4e00-\u9fa5]/g,'')" onpaste="return false" ondragenter="return false"  style="ime-mode:disabled" #end name="#(claLowName??).#(col.name ??)" lay-verify="required"
					autocomplete="off" placeholder="请输入#(col.remarks ??)" class="layui-input">
			</div>
		</div>
		#end
		
		#if(col.name != "id" && col.javaType == "java.util.Date")
		<div class="layui-form-item">
			<label class="layui-form-label">#(col.remarks ??)</label>
			<div class="layui-input-block">
				<input id="date#(for.index ??)" readonly="readonly" type="text" name="#(claLowName??).#(col.name ??)" lay-verify="required"
					autocomplete="off" placeholder="请输入#(col.remarks ??)" class="layui-input">
			</div>
		</div>
		#end
		
		#end
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn" lay-submit="" lay-filter="demo1">立即提交</button>
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>
</div>
#("#")include("/assets/comm/_resource.html")
<script>
layui.use(['form','jquery','layer','laydate'], function(){
	var form = layui.form;
	var $ = layui.jquery;
	var layer = layui.layer;
	var laydate = layui.laydate;
	form.on('submit(demo1)',function(data){
		console.log(JSON.stringify(data.field))
		$.ajax({
			url:'#("#")(CONTEXT_PATH)/#(rootRouteLowName)/#(claLowName??)/saveOrUpdate',
			type:'POST',
			data:data.field,
			success:function(res){
				console.log(JSON.stringify(res));
				parent.jtUtil.reloadTable2();
				parent.jtUtil.closeAll();
			}
		});
		
		return false;
	});
	
	#for(col : cols)
	#if(col.javaType =="java.util.Date")
	laydate.render({
	    elem: '#("#")date#(for.index ??)' //指定元素
	    ,format: 'yyyy-MM-dd' //可任意组合
	});
	#end
	#end
	
	
	form.render();
});
</script>
